<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>目录管理</title>
    <link rel="stylesheet" href="../../assets/libs/layui/css/layui.css"/>
    <link rel="stylesheet" href="../../assets/module/dtree/dtree.css"/>
    <link rel="stylesheet" href="../../assets/module/dtree/font/dtreefont.css"/>
    <link rel="stylesheet" href="../../assets/libs/ztree/css/zTreeStyle/zTreeStyle.css">
    <link rel="stylesheet" href="../../assets/module/admin.css?v=313"/>
    <link rel="stylesheet" href="../../assets/css/publicStyle.css"/>
    <!--[if lt IE 9]>
    <script src="../../assets/libs/html5shiv.min.js"></script>
    <script src="../../assets/libs/respond.min.js"></script>
    <![endif]-->
    <style>
        #menuGroup-tmpl-box{
            float: left;
        }
        #page-box{
            float: right;
        }
        #page-box .layui-laypage{
            margin: 0;
        }
        #menuManage{
            margin: 2px 0;
        }
        .layui-table-view{
            margin: 0;
        }
    </style>
<body class="layui-layout-body hide-body-title">
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body">
            <div class="layui-row">
                <div class="layui-col-xs6 layui-col-md6 layui-col-lg6">
                    <div class="layui-card-body">
                        <div class="layui-form toolbar">
                            <div class="layui-card-header">
                                目录分组
                            </div>
                            <div class="layui-row">
                                <div id="menuGroup-tmpl-box"></div>
                                <div id="page-box"></div>
                            </div>
                            <table class="layui-table" id="menuManage" lay-filter="menuManage"></table>

                        </div>
                    </div>
                </div>
                <div class="layui-col-xs6 layui-col-md6 layui-col-lg6">
                    <div class="layui-card-body">
                        <div class="layui-form toolbar">
                            <div class="layui-card-header">
                                目录
                            </div>
                            <div class="layui-row">
                                <div id="menuValue-tmpl-box"></div>
                            </div>
                        </div>
<!--                        <div id="treeTbTree"></div>-->
                        <ul id="treeTbTree" class="ztree" ></ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 目录分组权限模板 -->
<script type="text/tmpl" id="menuGroup-tmpl">
     <div class="layui-form-item">
        {{ if hasPower("/meta/menu-group:queryList")}}
        <div class="layui-inline">
            <div class="layui-input-inline mr0">
                <input name="groupName" class="layui-input" type="text"
                       placeholder="输入关键字">
            </div>
        </div>
        {{/if}}

        <div class="layui-inline">
        {{ if hasPower("/meta/menu-group:queryList")}}
            <button class="layui-btn icon-btn layui-btn-sm" lay-filter="formSubSearchTbBas" lay-submit="formSubSearchTbBas">
                <i class="layui-icon"></i>搜索
            </button>
            {{/if}}
            {{ if hasPower("/meta/menu-group:add")}}
            <button class="layui-btn icon-btn layui-btn-sm" id="addMenuGroup">
                <i class="layui-icon"></i>新增
            </button>
            {{/if}}
        </div>
    </div>
</script>
<!-- 目录值权限模板 -->
<script type="text/tmpl" id="menuValue-tmpl">
    {{ if hasPower("/meta/menu-value:add")}}
    <button id="addMenuValueBtn" class="layui-btn icon-btn layui-btn-sm">
        <i class="layui-icon"></i>新增
    </button>
    {{/if}}
     {{ if hasPower("/meta/menu-value:edit")}}
    <button id="editMenuValueBtn" class="layui-btn icon-btn layui-btn-sm">
        <i class="layui-icon"></i>编辑
    </button>
    {{/if}}
     {{ if hasPower("/meta/menu-value:delete")}}
    <button id="deleteMenuValueBtn" class="layui-btn icon-btn layui-btn-sm">
        <i class="layui-icon"></i>删除
    </button>
    {{/if}}
</script>

<script type="text/tmpl" id="menuGroupTableTmpl">
    {{ if hasPower("/meta/menu-group:edit")}}
     <a class="layui-btn layui-btn-xs layui-btn-warning" lay-event="edit">编辑</a>
     {{/if}}
     {{ if hasPower("/meta/menu-group:delete")}}
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
    {{/if}}
</script>

<!-- 目录分组表格操作列 -->
<script type="text/html" id="menuGroupTableTmplBox">
</script>

<!--新增目录分组弹窗-->
<script type="text/html" id="addMenuGroupForm">
    <form id="modelUserForm" lay-filter="modelUserForm" class="layui-form model-form">
        <div class="layui-form-item">
            <label class="layui-form-label">名称</label>
            <div class="layui-input-block">
                <input name="name" placeholder="请输入名称" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required"  />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">描述</label>
            <div class="layui-input-block">
                <textarea name="memo" placeholder="请输入描述信息" class="layui-textarea" maxlength="20"
                          lay-verType="tips" lay-verify="" />
            </div>
        </div>
        <div class="layui-form-item text-right">
            <button class="layui-btn layui-btn-primary" type="button" ew-event="closePageDialog">取消</button>
            <button class="layui-btn" lay-filter="modelSubmitUser" lay-submit>确定</button>
        </div>
    </form>
</script>

<!--编辑目录分组弹窗-->
<script type="text/html" id="editMenuGroupModel">
    <form id="editMenuGroupForm" lay-filter="modelUserForm" class="layui-form model-form">
        <div class="layui-form-item">
            <label class="layui-form-label">名称</label>
            <div class="layui-input-block">
                <input name="name" placeholder="请输入名称" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required"  />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">描述</label>
            <div class="layui-input-block">
                <textarea name="memo" placeholder="请输入描述信息" class="layui-textarea" maxlength="20"
                          lay-verType="tips" lay-verify="" />
            </div>
        </div>
        <div class="layui-form-item text-right">
            <button class="layui-btn layui-btn-primary" type="button" ew-event="closePageDialog">取消</button>
            <button class="layui-btn" lay-filter="modelSubmitUser" lay-submit>确定</button>
        </div>
    </form>
</script>

<!--新增目录值弹窗-->
<script type="text/html" id="addMenuValueModel">
    <form id="addMenuValueForm" lay-filter="modelUserForm" class="layui-form model-form">
        <div class="layui-form-item">
            <label class="layui-form-label">名称</label>
            <div class="layui-input-block">
                <input name="name" placeholder="请输入名称" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required"  />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">描述</label>
            <div class="layui-input-block">
                <textarea name="memo" placeholder="请输入描述信息" class="layui-textarea" maxlength="20"
                          lay-verType="tips" lay-verify="" />
            </div>
        </div>
        <div class="layui-form-item text-right">
            <button class="layui-btn layui-btn-primary" type="button" ew-event="closePageDialog">取消</button>
            <button class="layui-btn" lay-filter="addMenuValue" lay-submit>确定</button>
        </div>
    </form>
</script>

<!--编辑目录值弹窗-->
<script type="text/html" id="editMenuValueModel">
    <div id="editMenuValueForm" lay-filter="modelUserForm" class="layui-form model-form">
        <div class="layui-form-item">
            <label class="layui-form-label">名称</label>
            <div class="layui-input-block">
                <input name="name" placeholder="请输入名称" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required"  />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">描述</label>
            <div class="layui-input-block">
                <textarea name="memo" placeholder="请输入描述信息" class="layui-textarea" maxlength="20"
                          lay-verType="tips" lay-verify="" />
            </div>
        </div>
        <div class="layui-form-item text-right">
            <button class="layui-btn layui-btn-primary" type="button" ew-event="closePageDialog">取消</button>
            <button class="layui-btn" lay-filter="editMenuValue" lay-submit>确定</button>
        </div>
    </div>
</script>

<!-- js部分 -->
<script type="text/javascript" src="../../assets/libs/layui/layui.js"></script>
<script type="text/javascript" src="../../assets/js/common.js?v=313"></script>
<script src="../../assets/libs/jquery/jquery-3.2.1.min.js"></script>
<!-- Ztree树部分 -->
<script src="../../assets/libs/ztree/js/jquery.ztree.core.min.js"></script>
<script src="../../assets/libs/ztree/js/jquery.ztree.exedit.js"></script>
<script src="../../assets/libs/ztree/js/jquery.ztree.excheck.min.js"></script>
<script src="../../assets/libs/copy/clipboard.min.js"></script>

<script src="../../assets/libs/template-web.js"></script>
<script src="../../assets/libs/axios.min.js"></script>
<script src="../../assets/js/config.js"></script>
<script src="../../assets/js/authority.js"></script>

<script src="../../assets/js/metadata/menuManage.js"></script>
</body>

</html>